/**
 * 个人出差记录业务逻辑处理实现类
 * @author 郑翎
 * 2015-10-1 11:07:43
 */
package com.cbts.service.person.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


import org.apache.struts2.ServletActionContext;
import org.springframework.beans.factory.annotation.Autowired;

import com.cbts.dao.ApplayReimDao;
import com.cbts.dao.BusinessTravelListDao;
import com.cbts.entity.ApplayReim;
import com.cbts.entity.BusinessTravelList;
import com.cbts.entity.UserInfo;
import com.cbts.service.person.PersonTravelInfoService;
import com.cbts.service.travel.ApplayReimService;
import com.opensymphony.xwork2.ActionContext;

public class PersonTravelInfoServiceImpl implements PersonTravelInfoService {

	private BusinessTravelListDao businessTravelListdaoImpl;  //出差列表数据处理类
	private ApplayReimDao applayReimDaoImpl;				  //报销记录表示数据处理类
	private ApplayReimService applayReimServiceImpl;		  //报销的业务逻辑处理类
	
	/*
	 * (non-Javadoc)
	 * @see com.cbts.service.person.PersonTravelInfoService#getBusinessTravelListMap(java.lang.String)
	 */
	public Map<String, List<BusinessTravelList>> getBusinessTravelListMap(String userid){
		
		
		String[] status ={"待审核","审核不通过","审核通过","待报销","报销不通过","已报销"};
		Map<String, List<BusinessTravelList>> statusTravellistMap = new HashMap<String, List<BusinessTravelList>>();
		String[] objet = new String[2];
		objet[0] = userid;
		
		for (int i = 0; i < status.length; i++) {
			
			String wherehql = " and userInfoByUserid.userid=? and verifierStatus=?";
			objet[1] = status[i];
			List<BusinessTravelList> businessTravelLists = businessTravelListdaoImpl.findByProperty(wherehql, objet, -1, -1).getPageItems();
			statusTravellistMap.put(status[i], businessTravelLists);
		}
		return statusTravellistMap;
	}

	public BusinessTravelListDao getBusinessTravelListdaoImpl() {
		return businessTravelListdaoImpl;
	}

	public void setBusinessTravelListdaoImpl(
			BusinessTravelListDao businessTravelListdaoImpl) {
		this.businessTravelListdaoImpl = businessTravelListdaoImpl;
	}

	public ApplayReimDao getApplayReimDaoImpl() {
		return applayReimDaoImpl;
	}

	public void setApplayReimDaoImpl(ApplayReimDao applayReimDaoImpl) {
		this.applayReimDaoImpl = applayReimDaoImpl;
	}

	public ApplayReimService getApplayReimServiceImpl() {
		return applayReimServiceImpl;
	}

	public void setApplayReimServiceImpl(ApplayReimService applayReimServiceImpl) {
		this.applayReimServiceImpl = applayReimServiceImpl;
	}

}
